Creates a Objective object, which may then be used to be added to the Objectives list.
Parent Type: LearningDataModel
Namespace: Microsoft.LearningComponents.DataModel
Assembly: Microsoft.LearningComponents.dll
| C# |
|
public Objective CreateObjective () |
A new Objective object associated with this LearningDataModel.
| Exception type | Condition |
| InvalidOperationException | Thrown if this LearningDataModel object cannot be written to. |
The following example demonstrates creating a new objective and adding it to the Objectives collection.
| C# |
LearningSession session = ... ; // get LearningSession object Objective o = session.CurrentActivityDataModel.CreateObjective(); o.Id = "objective1"; // A unique identifier is required before this is added to the list o.Description = "a description of objective 1"; session.CurrentActivityDataModel.Objectives.Add(o); |